package com.tlsy.commerce.model.multiTenant;

import com.tlsy.commerce.model.IdEntity;
import com.tlsy.commerce.model.converter.StatusConverter;
import com.tlsy.commerce.model_enum.StatusEnum;
import com.tlsy.commerce.multi_tenant.TenantHolder;
import lombok.Getter;
import lombok.Setter;
import org.eclipse.persistence.annotations.Multitenant;
import org.eclipse.persistence.annotations.TenantDiscriminatorColumn;

import javax.persistence.Column;
import javax.persistence.Convert;
import javax.persistence.Entity;
import javax.persistence.Table;

/**
 * 卖家商铺
 * @author Tlsy
 * @version commerce 0.0.1
 * @date 2017/4/13  14:56
 */
@Entity
@Table(name = "shop")
@Getter
@Setter
@Multitenant
@TenantDiscriminatorColumn(name = "user_id", length=42, contextProperty = TenantHolder.TENANT_ID)
public class Shop extends IdEntity{
    private static final long serialVersionUID = 5603256512103347169L;

    @Column(name = "shop_status")
    @Convert(converter = StatusConverter.class)
    private StatusEnum status;
}
